home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_jade.idb / usr / freeware / include / sp / lib / EventQueue.h.z / EventQueue.h
Encoding:
C/C++ Source or Header  |  1999-07-21  |  1016 b   |  59 lines

  1. // Copyright (c) 1994 James Clark
  2. // See the file COPYING for copying permission.
  3.  
  4. #ifndef EventQueue_INCLUDED
  5. #define EventQueue_INCLUDED 1
  6.  
  7. #include "IQueue.h"
  8. #include "Event.h"
  9.  
  10. #ifdef SP_NAMESPACE
  11. namespace SP_NAMESPACE {
  12. #endif
  13.  
  14. class EventQueue : public EventHandler, public IQueue<Event> {
  15. public:
  16.   EventQueue();
  17. private:
  18. #define EVENT(c, f) void f(c *);
  19. #include "events.h"
  20. #undef EVENT
  21.   void append(Event *);
  22. };
  23.  
  24. class Pass1EventHandler : public EventQueue {
  25. public:
  26.   Pass1EventHandler();
  27.   void init(EventHandler *origHandler);
  28.   void message(MessageEvent *);
  29.   Boolean hadError() const;
  30.   EventHandler *origHandler() const;
  31. private:
  32.   Boolean hadError_;
  33.   EventHandler *origHandler_;
  34. };
  35.  
  36. inline
  37. void EventQueue::append(Event *event)
  38. {
  39.   IQueue<Event>::append(event);
  40. }
  41.  
  42. inline
  43. Boolean Pass1EventHandler::hadError() const
  44. {
  45.   return hadError_;
  46. }
  47.  
  48. inline
  49. EventHandler *Pass1EventHandler::origHandler() const
  50. {
  51.   return origHandler_;
  52. }
  53.  
  54. #ifdef SP_NAMESPACE
  55. }
  56. #endif
  57.  
  58. #endif /* not EventQueue_INCLUDED */
  59.